<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <meta name="viewport" content="width=device-width, initial-scale=1"/>
    <meta name="author" content="CH.HUANG" />
    <meta name="description" content=""/>
    <meta name="keywords" content="" />
    <title>EWCRM--<sitemesh:write property='title' /></title>
    <!-- ========== Css Files ========== -->
    <link href="/css/root.css" rel="stylesheet"/>
    <!-- ================================================
    jQuery Library
    ================================================ -->
    <script src="/js/jquery.min.js"></script>
    <!-- ================================================
    Bootstrap Core JavaScript File
    ================================================ -->
    <script src="/js/bootstrap/bootstrap.min.js"></script>
    <!-- ================================================
    Plugin.js - Some Specific JS codes for Plugin Settings
    ================================================ -->
    <script src="/js/plugins.js"></script>
    <!-- ================================================
    Data Tables
    ================================================ -->
    <script src="/js/datatables/jquery.dataTables.min.js"></script>
    <script src="/js/datatables/dataTables.buttons.min.js"></script>
    <script src="/js/datatables/dataTables.select.min.js"></script>
    <script src="/js/datatables/datatables.zh_cn.js"></script>

    <script src="/js/jquery.cookie.min.js"></script>
    <script src="/js/vue.min.js" ></script>
    <script src="/js/fetch.min.js" ></script>
    <script src="/js/spop/spop.min.js" ></script>
    <script src="/js/loading/loading.js" ></script>
    <script src="/js/sweet-alert/sweet-alert.min.js"></script>
    <script src="/js/kode-alert/main.js"></script>
    <script src="/js/jquery.fancybox.min.js"></script>
    <script src="/js/dropify.min.js"></script>

    <script src="/js/common.js"></script>
    <script src="/js/fetchFun.js"></script>
    <!-- 从被装饰页面获取body标签内容 -->
    <sitemesh:write property='head' />
</head>
<body>
    <!-- Start Page Loading -->
    <div class="loading"><img src="/img/loading.gif" alt="loading-img"></div>
    <!-- End Page Loading -->
    <!-- //////////////////////////////////////////////////////////////////////////// -->
    <!-- START TOP -->
    <div id="top" class="clearfix">

        <!-- Start App Logo -->
        <div class="applogo">
            <a href="/admin/index" class="logo">EWCRM</a>
        </div>
        <!-- End App Logo -->

        <!-- Start Sidebar Show Hide Button -->
        <a href="javascript:void(0)" class="sidebar-open-button"><i class="fa fa-bars"></i></a>
        <a href="javascript:void(0)" class="sidebar-open-button-mobile"><i class="fa fa-bars"></i></a>
        <!-- End Sidebar Show Hide Button -->

        <!-- Start Top Right -->
        <ul class="top-right">

            <li th:if="${session.sysUser!=null}" class="dropdown link">
                <a href="javascript:void(0)" data-toggle="dropdown" class="dropdown-toggle profilebox">
                    <img th:if="${session.sysUser.userphoto!=null}" th:src="${session.sysUser.userphoto}" alt="img">
                    <b th:if="${session.sysUser.fullname!=null}" th:text="${session.sysUser.fullname}"></b>
                    <b th:unless="${session.sysUser.fullname!=null}" th:text="${session.sysUser.username}"></b>
                    <span class="caret"></span>
                </a>
                <ul class="dropdown-menu dropdown-menu-list dropdown-menu-right">
                    <li role="presentation" class="dropdown-header">个人中心</li>
                    <!--<li><a href="javascript:void(0)"><i class="fa falist fa-inbox"></i>通知消息<span class="badge label-danger">4</span></a></li>-->
                    <li><a href="/admin/selfinfo"><i class="fa falist fa-user"></i>修改个人信息</a></li>
                    <li><a href="/admin/selfpwd"><i class="fa falist fa-wrench"></i>修改密码</a></li>
                    <li class="divider"></li>
                    <li><a id="logoutBtn" href="javascript:void(0)"><i class="fa falist fa-power-off"></i>退出</a></li>
                </ul>
            </li>

        </ul>
        <!-- End Top Right -->

    </div>
    <!-- END TOP -->
    <!-- //////////////////////////////////////////////////////////////////////////// -->

    <!-- //////////////////////////////////////////////////////////////////////////// -->
    <!-- START SIDEBAR -->
    <div class="sidebar clearfix">

        <ul id="menus" class="sidebar-panel nav">
            <li class="sidetitle">主菜单</li>
            <li th:each="menu,stat : ${menus}">
                <a th:href="${menu.menuUrl==null?'javascript:void(0)':menu.menuUrl}">
                    <span th:class="|icon color-${stat.index+1}|">
                        <i th:class="|fa ${menu.parentMenuId}|"></i>
                    </span>
                    <th:block th:text="${menu.menuName}"></th:block>
                    <span th:unless="${#lists.isEmpty(menu.sysRoleMenus)}" class="caret"></span>
                </a>
                <ul th:unless="${#lists.isEmpty(menu.sysRoleMenus)}">
                    <li th:each="roleMenu : ${menu.sysRoleMenus}">
                        <a th:href="${roleMenu.menuUrl}" th:text="${roleMenu.menuName}"></a>
                    </li>
                </ul>
            </li>

        </ul>

    </div>
    <!-- END SIDEBAR -->
    <!-- //////////////////////////////////////////////////////////////////////////// -->

    <!-- //////////////////////////////////////////////////////////////////////////// -->
    <!-- START CONTENT -->
    <div class="content">

        <!-- Start Page Header -->
        <div class="page-header">
            <h1 id="title" class="title"></h1>
            <ol id="breadcrumb" class="breadcrumb">
                <li>一级菜单名称</li>
                <li class="active">二级菜单名称</li>
            </ol>

            <!-- Start Page Header Right Div -->
            <div class="right">
                <div class="btn-group" role="group" aria-label="...">
                    <a href="/admin/index" class="btn btn-light">统计面板</a>
                    <a href="javascript:location.reload();" class="btn btn-light"><i class="fa fa-refresh"></i></a>
                </div>
            </div>
            <!-- End Page Header Right Div -->

        </div>
        <!-- End Page Header -->


        <!-- //////////////////////////////////////////////////////////////////////////// -->
        <!-- START CONTAINER -->
        <div class="container-widget">
            <!-- 从被装饰页面获取body标签内容 -->
            <sitemesh:write property='body' />
        </div>

        <!-- Start Footer -->
        <div class="row footer">
            <div class="col-md-12 text-left">
                Copyright &copy; <span id="thisYear"></span>.江苏广福钢铁物资有限公司 All rights reserved.
            </div>
        </div>
        <!-- End Footer -->

    </div>
    <!-- End Content -->
    <!-- //////////////////////////////////////////////////////////////////////////// -->

    <!-- Start an Alert -->
    <div id="alerttop" class="kode-alert kode-alert-icon kode-alert-click alert6 kode-alert-top">
        <i class="fa fa-user"></i>
        <span id="errorMesage">This is an example top alert. You can edit what u wish. </span>
        <a href="javascript:void(0)">点击这里关闭</a>
    </div>
    <!-- End an Alert -->

    <!-- Start an Alert -->
    <div id="alertbottom" class="kode-alert kode-alert-icon kode-alert-click alert3 kode-alert-bottom">
        <i class="fa fa-user"></i>
        <span id="successMessage">This is an example top alert. You can edit what u wish. </span>
        <a href="javascript:void(0)">点击这里关闭</a>
    </div>
    <!-- End an Alert -->

    <script>
        $(function(){
            var date=new Date();
            $('#thisYear').text(date.getFullYear());

            //退出
            $('#logoutBtn').click(function () {
                get('/service/logout',function (data) {
                    if(data.success){
                        location.href = '/';
                    }
                })
            });

            //当前地址菜单项添加 active class
            var url = window.location.pathname;
            $('#menus a').removeClass('active');
            var activeMenu = $('#menus a[href="'+url+'"]');
            activeMenu.addClass('active');
            //设置title
            var title = activeMenu.text();
            $('#title').text(title);
            $('#breadcrumb').empty();
            $('#breadcrumb').prepend('<li class="active">'+title+'</li>');
            var pMenu = activeMenu.parent("li").parent("ul").prev('a');
            if(pMenu.length!=0){//判断有上级菜单
                $('#breadcrumb').prepend('<li>'+pMenu.text()+'</li>');
                //设置上级菜单显示
                activeMenu.parent("li").parent("ul").css('display','block');
            }
        });

    </script>
</body>
</html>